/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-04-11
 * Time: 17:50
 * To BE A Better Person-2020-3-2
 */
class Time{
    int year;
    int month;
    int day;

    public Time(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    @Override
    public String toString() {
        return "Time{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }
}
class Student implements Cloneable{
    int id;
    Time time=new Time(2022,4,11);
    public Student(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                this.time.toString()+
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        Student tmp=(Student) super.clone();
        tmp.time=new Time(2022,4,12);
        return tmp;
    }
}
public class TestDemo {
    public static void main(String[] args) throws CloneNotSupportedException{
        Student s1=new Student(36);
        Student s2=(Student)s1.clone();
        s2.time.day=20;
        System.out.println(s1.toString());
        System.out.println(s2.toString());
    }



}
